<form action="<?php echo BASE_URL;?>/test/gradingtest" method="post" id="test-form">
		<input type="hidden" name="test_id" id="test_id" value="<?php echo $this->data['test_id'];?>">
		<?php
			$question_id    = $this->data['question_id']; // danh sách id của câu hỏi
			$question_score = $this->data['question_score'];  // điểm làm bài của user
			$answer_of_user = $this->data['question']; // các câu trả lời của user
			$list_score_in_test_table = $this->data['list_score_in_test_table'];
			$test_id = $this->data['test_id'];
			
			$questionPerPage	= $this->data['question_perpage'];
			$questionPerPage 	= $questionPerPage==0? 1:$questionPerPage;
			$totalQuestion		= count($list_questionID);
			$totalPage			= (int)($totalQuestion/$questionPerPage);
			$totalPage			= $totalQuestion%$questionPerPage==0?$totalPage:($totalPage+1) ;
			$link = "<div class='page_review_test'><font style='font-size: 16px; font-weight: bold; '>Trang: </font> ";
				for($i=0;$i<$totalPage;$i++)
					$link .= "Trang &nbsp;<a href='#' onclick='showPage($i,$questionPerPage); return false;'><span class='focus-page-test-1'> ".($i+1)."</span></a> &nbsp;&nbsp;";
			$link .="</div>";	
			echo $link;
			
			if(count($question_id)>0){
				foreach ($question_id as $key=>$question_idItem){
							// Begin Lấy đường dẫn tuyệt đối cho hình ảnh
							$HTML = $this->viewQuestion($test_id,trim($question_idItem), "Câu ".($key+1)." : ",$answer_of_user[$question_idItem],$this->review_test,$this->view_corect,$this->view_feedback,$this->view_send_result,$question_score[$key], $list_score_in_test_table[$key]);
							$HTML = Zend_View_Helper_FormatDate::_tinyMce_get_absolute_path_image("../../../media/images/tinymce","http://".$_SERVER['SERVER_NAME'].BASE_URL."/media/images/tinymce" ,$HTML);
							// End lấy đường dẫn tuyệt đối cho hình ảnh
							echo  $HTML;
					echo "<span class='separator-question-test'><hr/></span>";
				}
				
				$link = "<div class='page_review_test'><font style='font-size: 16px; font-weight: bold; '>Trang: </font> ";
				for($i=0;$i<$totalPage;$i++)
					$link .= "Trang &nbsp;<a href='#' onclick='showPage($i,$questionPerPage); return false;'><span class='focus-page-test-2'> ".($i+1)."</span></a> &nbsp;&nbsp;";			$link .="</div>";
				echo $link;				
			} 
		 ?>		
		 <input type="hidden" class="question_per_page" value="<?php echo $questionPerPage; ?>">
		 <a  class="all-bt-do-test" href="#" onclick="endTestFormConfirm(); return false;">Gửi kết quả bài thi</a>&nbsp;&nbsp;&nbsp;&nbsp;
		</form>
		<hr/>
<script type="text/javascript" language="javascript">
<!--
$(document).ready(function(){
	$(".question-container-div").hide()
	$(".separator-question-test").hide()
	var question_per_page = $(".question_per_page").val();
	showPage(0,question_per_page);
	$(".focus-page-test").eq(0).addClass("focus-page-test-active");
});

function InitTestAgain(testid){
	alert(testid);
}

function focusPage(up_or_down,currentPage){
	page_obj  = $(".focus-page-test-"+up_or_down);
	page_obj.removeClass("focus-page-test-active");
	page_obj.eq(currentPage).addClass("focus-page-test-active");
}
function showPage(currentPage, questionPerpage)
{
	focusPage(1,currentPage);
	focusPage(2,currentPage);
	$(".question-container-div").hide()
	$(".separator-question-test").hide()
	var start  	= currentPage*questionPerpage;
	var end		= start+questionPerpage;
	for(i=start; i< end; i++){
		$(".separator-question-test").eq(i).show();
		$(".question-container-div").eq(i).show();
	}
}
function endTestFormConfirm() {
	if(confirm("Bạn chắc chắn muốn nộp bài?")==true)
		$("#test-form").submit();
}
//-->
</script>
